import { RouteRecordRaw } from 'vue-router';

const router: RouteRecordRaw[] = [
  {
    path: '/authority',
    name: 'authority',
    redirect: { name: 'authorityLayout' },
    component: () => import('@/layouts/LayoutFirst.vue'),
    children: [
      {
        path: '/authority/',
        name: 'authorityLayout',
        redirect: { name: 'company' },
        component: () => import('@/layouts/LayoutSecond.vue'),
        children: [
          {
            path: '/authority/company',
            name: 'company',
            component: () => import('@/pages/authority/views/company.vue'),
            meta: {
              title: {
                isBack: true,
                list: [{ label: '公司管理' }],
              },
            },
          },
          {
            path: '/authority/admin',
            name: 'admin',
            component: () => import('@/pages/authority/views/admin.vue'),
            meta: {
              title: {
                isBack: false,
                list: [{ label: '账号管理' }],
              },
            },
          },
          {
            path: '/authority/user',
            name: 'user',
            component: () => import('@/pages/authority/views/user.vue'),
            meta: {
              title: {
                isBack: false,
                list: [{ label: '用户管理' }],
              },
            },
          },
          {
            path: '/authority/role',
            name: 'role',
            component: () => import('@/pages/authority/views/role.vue'),
            meta: {
              title: {
                isBack: false,
                list: [{ label: '角色管理' }],
              },
            },
          },
          {
            path: '/authority/authority',
            name: 'authority',
            component: () => import('@/pages/authority/views/authority.vue'),
            meta: {
              title: {
                isBack: false,
                list: [{ label: '权限管理' }],
              },
            },
          },
        ],
      },
    ],
  },
];

export default router;
